package com.kma.summer2012.client.events;

import com.google.gwt.event.shared.EventHandler;
import com.google.gwt.event.shared.GwtEvent;

import java.util.Date;

/**
 * Created with IntelliJ IDEA.
 * User: EUGENE
 * Date: 3/3/13
 * Time: 2:47 PM
 * To change this template use File | Settings | File Templates.
 */
public class SortByDateEvent extends GwtEvent<SortByDateEvent.SortByDateEventHandler> {
    private static Type<SortByDateEventHandler> TYPE = new Type<SortByDateEventHandler>();

    public Date date;
    public Integer tableID;

    public SortByDateEvent(Date date, Integer tableID) {
        this.date = date;
        this.tableID = tableID;
    }

    @Override
    public Type<SortByDateEventHandler> getAssociatedType() {
        return TYPE;
    }

    public static Type<SortByDateEventHandler> getType() {
        return TYPE;
    }

    @Override
    protected void dispatch(SortByDateEventHandler sortByDateEventHandler) {
        sortByDateEventHandler.onSortByDate(this);
    }

    public interface SortByDateEventHandler extends EventHandler {
        void onSortByDate(SortByDateEvent event);
    }
}
